module.exports = {
  devServer: {
    port: '8080',
    open: true,
    proxy: {
      '/api': {
        target: ' http://localhost:8081',
        changeOrigin: true,
        pathRewrite: { '^/api': 'http://localhost:8080/' }
      }
    }
  },
  chainWebpack: config => {
    config
      .plugin('html')
      .tap(args => {
        args[0].title = '访客登记'
        return args
      })

    config.module
      .rule('eslint')
      .use('eslint-loader')
      .loader('eslint-loader')
      .tap(options => {
        options.fix = true
        return options
      })
  }
}